import { View, Text } from '@tarojs/components'

interface TodoFooterProps {
  activeTab: 'today' | 'templates' | 'history';
  totalCount: number;
  completedCount: number;
  clearCompletedTodos: () => void;
  clearAllTodos: () => void;
}

const TodoFooter: React.FC<TodoFooterProps> = ({
  activeTab,
  totalCount,
  completedCount,
  clearCompletedTodos,
  clearAllTodos
}) => {
  if (activeTab !== 'today' || totalCount === 0) {
    return null;
  }

  return (
    <View className='todo-footer'>
      <Text className='todo-stats'>
        已完成 {completedCount} / 全部 {totalCount}
      </Text>
      <View className='todo-actions-group'>
        {completedCount > 0 && (
          <Text className='todo-clear-completed' onClick={clearCompletedTodos}>
            清除已完成任务
          </Text>
        )}
        <Text className='todo-clear-all' onClick={clearAllTodos}>
          清除已选中任务
        </Text>
      </View>
    </View>
  );
};

export default TodoFooter; 